<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="layout/TemplateUsuario.xhtml">

	<ui:define name="body">
		<h1><h:outputText value="#{messages.postar}" /></h1>

		<h:form enctype="multipart/form-data">

			<s:decorate template="layout/edit.xhtml">
				<ui:define name="label">
					<h:outputText value="#{messages.titulo}" />
				</ui:define>

				<h:inputText value="#{postCtrl.post.titulo}" required="true" maxlength="50" size="50" />
			</s:decorate>
			
			<s:decorate template="layout/edit.xhtml">
				<ui:define name="label">
					<h:outputText value="#{messages.imagemPost}" />
				</ui:define>
				
				<s:fileUpload data="#{postCtrl.post.imagem}" value="#{postCtrl.post.imagem}" accept="image/gif" />
			</s:decorate>

			<div style="clear:both" />
			
			<rich:editor value="#{postCtrl.post.texto}" required="true" width="400" height="300" theme="advanced" />
			
			<div style="clear:both" />
			
			<s:decorate template="layout/edit.xhtml" style="text-align: left;">
				<ui:define name="label">
					<h:outputText value="#{messages.tagsPost}" />
				</ui:define>
				<h:panelGrid columns="1" style="text-align: left;">
					<h:inputText value="#{postCtrl.tagsPostTexto}" required="true" size="70" maxlength="50" />
					<h:outputLabel styleClass="informacaoCampo" value="(Digite tags separadas por virgulas)" />
				</h:panelGrid>
			</s:decorate>	
			
			<div style="clear:both" />
			
			<rich:spacer height="5" />
			
			<s:div styleClass="actionButtons">
				<h:commandButton action="#{postCtrl.salvar}"
					value="#{messages.actionSave}" />
				<h:commandButton action="/home.xhtml"
					value="#{messages.actionCancelar}" />
			</s:div>

		</h:form>
	</ui:define>

</ui:composition>
